<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/vue.js"></script>
    <style>
        .red {
            color: red;
        }

        .pink {
            color: palevioletred;
        }
        .blue {
            color: aqua;
        }
    </style>
</head>
<body>
<div id="app">
    <com css="red"></com>
    <com css="pink"></com>
    <com css="blue"></com>
</div>
    <com></com>
<script>
    let com = {
        template:`
        <div :class="css">
        我的第一个局部组件 <br>
        <span @click="change">森怕森透,{{num}}</span>
        </div>
        `,
        data: function () {
            return {
                num: '666'
            }
        },
        props: ['css'],
        methods: {
            change(){
                this.num --
            }
        }
    }


    new Vue({
        el: '#app',
        data: {},
        components: {
            com: com,
        }
    })
</script>
</body>
</html>